#ifndef __CPPJIEBA_H__
#define __CPPJIEBA_H__

#include "../../lib/cppjieba/Jieba.hpp" 
#include "SplitTool.h"
#include <pthread.h>
#include <vector>
#include <string>

using namespace std;

// 结巴分词类,单例模式，自动释放
class CppJieba
:public SplitTool
{
public:
    static CppJieba* getInstance();
   
    virtual vector<string> cut(const string& word) override;

private:
    CppJieba();
    virtual ~CppJieba();

    static void init_r();
    
    static void destory();

private:
    static CppJieba* _pInstance;
    static pthread_once_t _once;
    cppjieba::Jieba _jieba;
};

#endif